﻿#define _CRT_SECURE_NO_WARNINGS 1
#include"snake.h"
void test()
{
	
	int ch = 0;
	do
	{
		
		//创建蛇身
		pSnakeNode pSnake = NULL;
		Snake snake = { 0 };
		//1、游戏开始
		GameStart(&snake);
		//2、游戏运行
		GameRun(&snake);
		//3、游戏结束
		GameEnd(&snake);
		SetPos(20, 15);
		printf("再来一局吗?(Y/N):");
		ch = getchar();
		getchar();
		
	} while (ch == 'y'|| ch == 'Y');
	SetPos(0, 27);
}

int main()
{
	srand((unsigned int)time(NULL));//设置随机数种子
	setlocale(LC_ALL, "");
	test();
	return 0;
}